﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace YummyGame.Framework
{
    public class ExpressionConst : Expression
    {
        public static readonly ExpressionConst Zero = new ExpressionConst(0);
        float value;
        public ExpressionConst(float value)
        {
            this.value = value;
        }

        public ExpressionConst(List<char> list)
        {
            for (int i = 0; i < list.Count; i++)
            {
                value += (list[i] - '0') * Mathf.Pow(10,(list.Count - i - 1));
            }
        }
        public override float Calculate()
        {
            return value;
        }

        public override object Clone()
        {
            return new ExpressionConst(this.value);
        }
    }
}
